#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main()
{
    int n = 0;
    int s = 0;
    scanf("%d", &n);
    if (n > 0)
    {
        int i = 0;
        for (i = 1; i <= n; i++)
        {
            int j = 0;
            int num = 1;
            for (j = 1; j <= i; j++)
            {
                num *= j;
            }
            s += num;
        }
        printf("%d\n", s);
    }
    else
    {
        printf("0");
    }
    return 0;
}